﻿<%@ WebHandler Language="C#" Class="get_sendemail" %>

using System;
using System.Web;
using System.Web.SessionState;
using TSqlServer;

public class get_sendemail : IHttpHandler, IReadOnlySessionState
{
    
    public void ProcessRequest (HttpContext context) {
        
        string sSQl = context.Request["ssql"].ToString();
        string inman = context.Session["ecrm_uid"].ToString();
        
        string result = "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">";
        result += "<thead>";
        result += "<tr bgcolor=\"#ffcc99\">";
        result += "<td width='30'><input type='checkbox' id='chkall' name='chkall' onclick=\"ischkall()\"></td>";
        result += "<td width='120'>邮件地址</td>";
        //result += "<td windth='100'>姓名</td>";
        //result += "<td>公司</td>";
        result += "</tr>";
        result += "</thead>";

        result += "<tbody>";
        //string sSql = sSQl + " and inman='" + inman + "' order by company";
        string sSql = sSQl;
        TSqlDBReader oRS = new TSqlDBReader(sSql);
        while (oRS.FDataReader.Read())
        {
            result += "<tr>";
            result += "<td><input type='checkbox' id='" + oRS.FDataReader.GetValue(oRS.FDataReader.GetOrdinal("uid")) + "' value='" + oRS.FDataReader.GetValue(oRS.FDataReader.GetOrdinal("email")) + "'></td>";
            result += "<td>" + oRS.FDataReader.GetValue(oRS.FDataReader.GetOrdinal("email")) + "</td>";
            //result += "<td>" + oRS.FDataReader.GetValue(oRS.FDataReader.GetOrdinal("linkman")) + "</td>";
            //result += "<td>" + oRS.FDataReader.GetValue(oRS.FDataReader.GetOrdinal("company")) + "</td>";
            result += "</tr>";
        }
        oRS.Free();
        result += "</tbody>";

        result += "</table>";

        context.Response.ContentType = "text/plain";
        context.Response.Write(result);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}